package com.szgr.baoyin.adapter;

import android.content.Context;
import android.graphics.BitmapFactory;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.szgr.baoyin.R;

/**
 * 放弃了
 * 服务站ListView的adapter
 * Created by Jimbo on 2015/9/17.
 */
public class StationListAdapter extends BaseAdapter {
    private Context mContext;
    public StationListAdapter(Context context){
        mContext = context;
    }

    @Override
    public int getCount() {
        return 7;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if(convertView == null){
            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_station_list_view,parent,false);
        }
        final ImageView img_right = (ImageView) convertView.findViewById(R.id.item_station_right);
        final View ll_bottom = convertView.findViewById(R.id.service_list_bottom);
        img_right.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                img_right.setImageBitmap(BitmapFactory.decodeResource(mContext.getResources(),R.drawable.arrow_white_down));
                ll_bottom.setVisibility(View.VISIBLE);
            }
        });
        return convertView;
    }
}